package com.uottawa.library.domain;

public class User {
	
	private String username;
	private String password;
	private int userId;
	private int balance;
	private String role;
	
	public User() {
	}

	/**
	 * @param username
	 * @param password
	 * @param userId
	 * @param balance
	 * @param role
	 */
	public User(int userId, String username, String password, int balance,
			String role) {
		super();
		this.username = username;
		this.password = password;
		this.userId = userId;
		this.balance = balance;
		this.role = role;
	}

	/**
	 * @param username
	 * @param password
	 * @param balance
	 * @param role
	 */
	
	/*
	public User(String username, String password, int balance, String role) {
		super();
		this.username = username;
		this.password = password;
		this.balance = balance;
		this.role = role;
	}
*/
	

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getBalance() {
		return balance;
	}

	public void setBalance(int newBalance) {
		balance = newBalance;
	}

	public boolean IsAuthorizedToLoan() {
		if (balance == 0)
			return true;
		else
			return false;
	}

	public void setRole(String newRole) {
		role = newRole;

	}

	/**
	 * @return the role
	 */
	public String getRole() {
		return role;
	}

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param username
	 *            the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @param password
	 *            the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}
}
